projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
210ae09
)
Allow string to be modified during parse. Ugh.
author
Robert Lipe
<robertlipe@gpsbabel.org>
Tue, 9 Oct 2018 03:27:05 +0000
(
03:27
+0000)
committer
Robert Lipe
<robertlipe@gpsbabel.org>
Tue, 9 Oct 2018 03:27:05 +0000
(
03:27
+0000)
csv_util.cc
patch
|
blob
|
history
diff --git
a/csv_util.cc
b/csv_util.cc
index 67854121a36bcc109b5ef827342f0c4530dce790..ba1685ed2b5740faec06f21a88c50f7a35f28db8 100644
(file)
--- a/
csv_util.cc
+++ b/
csv_util.cc
@@
-1441,8
+1441,9
@@
xcsv_data_read(void)
}
if (!buff.isEmpty()) {
Waypoint* wpt_tmp = new Waypoint;
-
- const char* s = strdup(CSTR(buff));
+ // tbuf is a temporary copy of buff since we modify it. :-(
+ char *tbuf = xstrdup(buff);
+ const char* s = tbuf;
s = csv_lineparse(s, CSTR(xcsv_file.field_delimiter),
CSTR(xcsv_file.field_encloser), linecount);
@@
-1518,6
+1519,7
@@
xcsv_data_read(void)
default:
;
}
+ xfree(tbuf);
}
}
}